using System;
using System.Collections;
using System.ComponentModel;
using System.Runtime.Serialization;


namespace Entities
{
    [Serializable]
    [System.Data.Services.Common.DataServiceKey("ID")]
    public class Product:EntityBase
    {
        #region Product Properties
        private System.Int32? _CateID;
		[DataMember] public virtual System.Int32? CateID
		{
			get
			{
				return _CateID;
			}
			set
			{
                if (_CateID != value)
                {
                    _CateID = value;
                    OnPropertyChanged("CateID");
                }
			}
		}
        private System.String _Name;
		[DataMember] public virtual System.String Name
		{
			get
			{
				return _Name;
			}
			set
			{
                if (_Name != value)
                {
                    _Name = value;
                    OnPropertyChanged("Name");
                }
			}
		}
        private System.String _ImageURL;
		[DataMember] public virtual System.String ImageURL
		{
			get
			{
				return _ImageURL;
			}
			set
			{
                if (_ImageURL != value)
                {
                    _ImageURL = value;
                    OnPropertyChanged("ImageURL");
                }
			}
		}
        private System.String _Description;
		[DataMember] public virtual System.String Description
		{
			get
			{
				return _Description;
			}
			set
			{
                if (_Description != value)
                {
                    _Description = value;
                    OnPropertyChanged("Description");
                }
			}
		}
        private System.Double? _Price;
		[DataMember] public virtual System.Double? Price
		{
			get
			{
				return _Price;
			}
			set
			{
                if (_Price != value)
                {
                    _Price = value;
                    OnPropertyChanged("Price");
                }
			}
		}
        private System.DateTime? _CreateDate;
		[DataMember] public virtual System.DateTime? CreateDate
		{
			get
			{
				return _CreateDate;
			}
			set
			{
                if (_CreateDate != value)
                {
                    _CreateDate = value;
                    OnPropertyChanged("CreateDate");
                }
			}
		}
        private System.Int32? _ViewNumber;
		[DataMember] public virtual System.Int32? ViewNumber
		{
			get
			{
				return _ViewNumber;
			}
			set
			{
                if (_ViewNumber != value)
                {
                    _ViewNumber = value;
                    OnPropertyChanged("ViewNumber");
                }
			}
		}
        private System.Int32? _Amount;
		[DataMember] public virtual System.Int32? Amount
		{
			get
			{
				return _Amount;
			}
			set
			{
                if (_Amount != value)
                {
                    _Amount = value;
                    OnPropertyChanged("Amount");
                }
			}
		}
        private System.String _CreateUserCode;
		[DataMember] public virtual System.String CreateUserCode
		{
			get
			{
				return _CreateUserCode;
			}
			set
			{
                if (_CreateUserCode != value)
                {
                    _CreateUserCode = value;
                    OnPropertyChanged("CreateUserCode");
                }
			}
		}
        #endregion
        public override bool Equals(object obj)
        {
            if (obj == this) return true;
            if (obj == null) return false;
            if (obj is Product)
            {
                return (this.ID == (obj as Product).ID);
            }
            return false;
        }
        public override int GetHashCode()
        {
            return ID.GetHashCode();
        }
    }
}